<template>
  <div class="box-card">
    <el-container>
      <el-header height="57px" class="pass-header"> </el-header>
      <el-main class="pass-main">
        <div class="defense">
          <div class="left-box">
            <div class="playground-container">
              <div class="playground-top">
                <div class="playground-top-item">
                  <img src="../../../../assets/image/shot/regain.svg" alt="" />
                  <span>重获球权</span>
                </div>
                <div class="playground-top-item">
                  <img
                    src="../../../../assets/image/shot/shotSquare.png"
                    alt=""
                  />
                  <span>成功解围</span>
                </div>
                <div class="playground-top-item">
                  <img
                    src="../../../../assets/image/shot/failedClearance.svg"
                    alt=""
                  />
                  <span>失败解围</span>
                </div>
                <div class="playground-top-item">
                  <img src="../../../../assets/image/shot/diamond.png" alt="" />
                  <span>成功抢断</span>
                </div>
                <div class="playground-top-item">
                  <img
                    src="../../../../assets/image/shot/failedInterception.svg"
                    alt=""
                  />
                  <span>失败抢断</span>
                </div>
                <div class="playground-top-item">
                  <img src="../../../../assets/image/shot/fork.png" alt="" />
                  <span>空中对抗</span>
                </div>
              </div>
              <PlayGround
                :my_regain="my_regain"
                :my_clearance="my_clearance"
                :my_failed_clearance="my_failed_clearance"
                :my_interception="my_interception"
                :my_failed_interception="my_failed_interception"
                :my_aerial_battle="my_aerial_battle"
              />
              <div class="legend">
                <img
                  class="attack-arrow"
                  src="../../../../assets/image/playerGround/rightArrow.png"
                  alt=""
                />
              </div>
            </div>
          </div>
          <div class="right-box">
            <div class="success-defense">
              <SuccessDefense />
            </div>
            <div class="defense-text">
              <span>成功防守次数</span>
              <el-tooltip
                class="item"
                effect="dark"
                :content="defense"
                placement="top"
              >
                <img
                  class="question-mark"
                  src="../../../../assets/image/common/question_mark.svg"
                  alt=""
                />
              </el-tooltip>
            </div>
            <div class="defense-table">
              <LeftTable />
              <RightTable />
            </div>
          </div>
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import PlayGround from "../../../playground/PlayGround";
import SuccessDefense from "./DefenseComp/SuccessDefense";
import LeftTable from "./DefenseComp/LeftTable";
import RightTable from "./DefenseComp/RightTable";
export default {
  name: "Defense",
  props: {
    playerId: {
      type: Number,
    },
  },
  components: {
    PlayGround,
    SuccessDefense,
    LeftTable,
    RightTable,
  },
  data() {
    return {
      //tooltip鼠标悬浮触发的文字解释
      defense:
        "成功防守包括成功解围、成功抢断、空中对抗、拦截、封堵传球和封堵射门",
      //当前活跃的el-tab
      activePane: "AllPass",
      //重获球权
      my_regain: [
        { x1: "50.70%", y1: "58.80%" },
        { x1: "30.70%", y1: "18.80%" },
        { x1: "67.70%", y1: "58.80%" },
      ],
      //成功解围
      my_clearance: [
        { x1: "20.70%", y1: "38.80%" },
        { x1: "80.70%", y1: "8.80%" },
        { x1: "17.70%", y1: "28.80%" },
      ],
      //失败解围
      my_failed_clearance: [
        { x1: "10.70%", y1: "58.80%" },
        { x1: "30.70%", y1: "48.80%" },
        { x1: "57.70%", y1: "28.80%" },
      ],
      //成功抢断
      my_interception: [
        { x1: "16.70%", y1: "71.80%" },
        { x1: "39.70%", y1: "77.80%" },
        { x1: "50.70%", y1: "11.80%" },
      ],
      //失败抢断
      my_failed_interception: [
        { x1: "26.70%", y1: "51.80%" },
        { x1: "19.70%", y1: "17.80%" },
        { x1: "50.70%", y1: "61.80%" },
      ],
      //空中对抗
      my_aerial_battle: [
        { x1: "30.70%", y1: "38.80%" },
        { x1: "50.70%", y1: "18.80%" },
        { x1: "75.70%", y1: "51.80%" },
      ],
    };
  },
};
</script>

<style scoped lang="scss">
.box-card {
  margin: auto;
  width: 1440px;
  height: 553px;
}
.pass-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background-color: #194568;
  padding: 0;
}
.pass-main {
  height: 496px;
  padding: 0;
  background-color: #f1f6f9;
}
.defense {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: space-between;
}
.left-box {
  height: 456px;
  margin-left: 90px;
}
.right-box {
  width: 560px;
  height: 413px;
  margin-top: 18px;
  margin-right: 70px;
  /*background-color: yellow;*/
  .success-defense {
    width: 100%;
    height: 150px;
    /*background-color: pink;*/
  }
  .defense-text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 8%;
    line-height: 33px;
    font-weight: bold;
    font-size: 20px;
    color: rgba(101, 111, 115, 0.75);
    /*background-color: #9a6e3a;*/
    .question-mark {
      width: 25px;
      height: 25px;
      margin-left: 5px;
    }
  }
  .defense-table {
    display: flex;
    height: 220px;
    margin-top: 5px;
    justify-content: space-between;
    /*background-color: red;*/
  }
}
.playground-container {
  position: relative;
  width: 620px;
  height: 456px;
  /*background-color: red;*/
  margin-top: 18px;
  .playground-top {
    display: flex;
    justify-content: space-between;
    width: 591px;
    color: #656f73;
    line-height: 25px;
    font-size: 16px;
    height: 25px;
    text-align: left;
    /*background-color: #656F73;*/
    .playground-top-item {
      width: 90px;
      height: 25px;
      /*background-color: yellow;*/
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        /*background-color: orange;*/
        width: 25px;
        height: 25px;
      }
    }
    .playground-top-item {
      /*width: 170px;*/
      /*margin-left: 20px;*/
      /*background-color: red;*/
    }
  }
  .playground-right {
    position: absolute;
    top: 30px;
    left: 603px;
    color: #bd1e1e;
    display: flex;
    justify-content: space-between;
    width: 17px;
    height: 383px;
    writing-mode: vertical-lr;
    font-size: 18px;
    .little-block {
      height: 3px;
      background-color: #bbbbbb;
      font-size: 25px;
    }
    .rate {
      /*background-color: red;*/
      line-height: 16px;
    }
  }
  .legend {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    width: 591px;
    height: 40px;
    .attack-arrow {
      width: 150px;
      /*height: 20px;*/
    }
  }
}
.ant-v {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /*background-color: red;*/
  line-height: 10px;
  width: 100%;
  height: 223px;
  .two-graph {
    display: flex;
    justify-content: space-between;
    .one-graph {
      width: 230px;
      height: 200px;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      .one-graph-title {
        height: 20px;
        line-height: 20px;
      }
    }
  }
  .graph-legend {
    height: 25px;
    color: #656f73;
    font-size: 14px;
    line-height: 25px;
  }
}
</style>
